package com.interview.javabasic.jvm;

public class Finalization {
    public static Finalization finalization;
    @Override
    protected void finalize(){
        System.out.println("Finalized");
        finalization = this;
    }

    public static void main(String[] args) {
        Finalization f = new Finalization();
        System.out.println("First print" + f);
        f = null;
        System.gc();
        System.out.println("second print" + f);
        System.out.println(f.finalization);
    }
}
